package com.homework.school;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/3/26 19:03
 * @description
 */
public class Graduate extends Student{

    private String studyDrection;

    public Graduate() {
    }

    public Graduate(String name, int age, String degree, String studyDrection) {
        super(name, age, degree);
        this.studyDrection = studyDrection;
    }

    public String getStudyDrection() {
        return studyDrection;
    }

    public void setStudyDrection(String studyDrection) {
        this.studyDrection = studyDrection;
    }

    public void getInfo(){
        System.out.println("姓名："+getName()+"\n" +
                "年龄："+getAge()+"\n" +
                "学位："+getDegree()+"\n" +
                "研究方向："+studyDrection+"\n");
    }

    @Override
    public String toString() {
        return "Graduate{" +
                "studyDrection='" + studyDrection + '\'' +
                '}';
    }
}
